//��Ϊ��������������޷�����OnlyHeader
#ifndef __JS300X_UART_HEADER__
#define __JS300X_UART_HEADER__
#include "MCUConfig.h"
#include "MCUUart.h"

//坑爹的是，如果缓冲区太小，可能导致检测数据错误
#define UART_RBUF_LEN 32 /* The length of Uart rx buffer       */
#define UART_TBUF_LEN 32 /* The length of Uart tx buffer       */
#define UART_STATE_RECV 0
#define UART_STATE_GETREADYDATA 1
#define UART_STATE_SEND 2

// typedef struct _buf_uart
// {
//     volatile bool rx_begin;      /* Uart rx begin deal                 */
//     volatile bool tx_begin;      /* Uart tx begin deal                 */
//     volatile u16 rx_index_put;   /* Uart rx put to rx buf index        */
//     volatile u16 tx_index_put;   /* Uart tx put to tx buf index        */
//     volatile u16 rx_index_get;   /* Uart rx get from rx buf index      */
//     volatile u16 tx_index_get;   /* Uart tx get from tx buf index      */
//     volatile u32 rx_cur_systick; /* rx cur systick cnt for deal timeout         */
//     volatile u32 tx_cur_systick; /* tx cur systick cnt for deal timeout         */
//     u8 rx_buf[UART_RBUF_LEN];    /* Uart rx buffer, if 9bit data dma method ,buf add must 16bit align               */
//     u8 tx_buf[UART_TBUF_LEN];    /* Uart tx buffer, if 9bit data dma method ,buf add must 16bit align               */
//     u16 tx_len;                  /*  Uart tx len */
// } TYPE_BUF_UART;
// extern TYPE_BUF_UART uart_buf; /* Uart rx buffer structure variable  */
extern u8 UartState;

// void JS300XUartInit(void);
// int JS300XUartRecv(void);
// int JS300XUartSend(void);
// void JS300XUARTSnd(Cmd cmd);

#endif
